Allow traversal of keymaps in new commands
authorjustbur <justin@burkett.cc>
Sun, 20 Dec 2015 20:54:53 +0000 (15:54 -0500)
committerjustbur <justin@burkett.cc>
Sun, 20 Dec 2015 20:54:53 +0000 (15:54 -0500)
which-key.el

index e5ca81dcc1fb1cee3edad8b768a005e2a83a2d29..0fdf6fe6255728063ac5aba03710524929d45576 100644 (file)
@@ -1869,7 +1869,13 @@ is selected interactively by mode in `minor-mode-map-alist'."
                           formatted-keys 0 which-key-side-window-location)))
             (t (setq which-key--pages-plist
                      (which-key--create-pages formatted-keys (window-width)))
-               (which-key--show-page 0))))))
+               (which-key--show-page 0)))))
+  (let* ((key (string (read-key)))
+         (next-def (lookup-key keymap key)))
+    (if (keymapp next-def)
+        (progn (which-key--hide-popup-ignore-command)
+               (which-key--show-keymap next-def))
+      (which-key--hide-popup))))
 
 (defun which-key--create-buffer-and-show (&optional prefix-keys)
   "Fill `which-key--buffer' with key descriptions and reformat.